
import axios from 'axios'

export function changePass (oldPassword, newPassword, token) {
  const url = '/users/password'

  const params = {
    old_password: oldPassword,
    new_password: newPassword
  }

  return axios({
    method: 'PUT',
    url,
    headers: {
      Authorization: `Bearer ${token}\n`
    },
    params
  }).then((res) => {
    return Promise.resolve(res.data)
  }).catch((err) => {
    return Promise.reject(err)
  })
}
